package entity;

import cn.hutool.core.util.StrUtil;
import entity.enums.HikDeviceStatus;
import entity.enums.HikLiftStatus;

/**
 * 车辆实时信息
 *
 * @author zhouwz
 * @date 2020/11/3 13:36
 */
public class VehicleRealtimeInfo {

    public VehicleRealtimeInfo(Integer x, Integer y, Integer angle, Point point, Integer power, HikDeviceStatus hikDeviceStatus) {
        this.x = x;
        this.y = y;
        this.angle = angle;
        this.point = point;
        this.power = power;
        this.hikDeviceStatus = hikDeviceStatus;
        this.hikLiftStatus = HikLiftStatus.UNKNOWN;
        this.actuatorIndex = 0;
    }

    /**
     * 任务id
     */
    private Short taskId;

    /**
     * 子任务ID
     */
    private Byte subTaskId;

    /**
     * 实时x坐标(*1000)
     */
    private Integer x;

    /**
     * 实时y坐标(*1000)
     */
    private Integer y;

    /**
     * 货架角度
     */
    private Integer shelfAngle;

    /**
     * 货架编号
     */
    private String shelfCode;

    /**
     * 实时角度
     */
    private Integer angle;

    /**
     * 途径过的最后一个点位
     */
    private Point point;

    /**
     * 当前电量
     */
    private Integer power;

    /**
     * 当前状态
     */
    private HikDeviceStatus hikDeviceStatus;

    /**
     * 举升状态
     */
    private HikLiftStatus hikLiftStatus;

    /**
     * 执行机构
     */
    private Byte actuatorIndex;

    public HikLiftStatus getHikLiftStatus() {
        return hikLiftStatus;
    }

    public void setHikLiftStatus(HikLiftStatus hikLiftStatus) {
        this.hikLiftStatus = hikLiftStatus;
    }

    public Byte getActuatorIndex() {
        return actuatorIndex;
    }

    public void setActuatorIndex(Byte actuatorIndex) {
        this.actuatorIndex = actuatorIndex;
    }

    public Short getTaskId() {
        return taskId;
    }

    public void setTaskId(Short taskId) {
        this.taskId = taskId;
    }

    public Byte getSubTaskId() {
        return subTaskId;
    }

    public void setSubTaskId(Byte subTaskId) {
        this.subTaskId = subTaskId;
    }

    public Integer getX() {
        return x;
    }

    public void setX(Integer x) {
        this.x = x;
    }

    public Integer getY() {
        return y;
    }

    public void setY(Integer y) {
        this.y = y;
    }

    public Integer getAngle() {
        return angle;
    }

    public void setAngle(Integer angle) {
        this.angle = angle;
    }

    public Point getPoint() {
        return point;
    }

    public void setPoint(Point point) {
        this.point = point;
    }

    public Integer getPower() {
        return power;
    }

    public void setPower(Integer power) {
        this.power = power;
    }

    public HikDeviceStatus getHikDeviceStatus() {
        return hikDeviceStatus;
    }

    public Integer getShelfAngle() {
        return shelfAngle;
    }

    public void setShelfAngle(Integer shelfAngle) {
        this.shelfAngle = shelfAngle;
    }

    public String getShelfCode() {
        return shelfCode;
    }

    public void setShelfCode(String shelfCode) {
        this.shelfCode = shelfCode;
    }

    public void setHikDeviceStatus(HikDeviceStatus hikDeviceStatus) {
        this.hikDeviceStatus = hikDeviceStatus;
    }

    @Override
    public String toString() {
        return StrUtil.format("点位别名:{},电量:{},角度:{},状态:{},举升:{},货架编号[{}]",
                point.getName(), power, angle, hikDeviceStatus.getMessage(), hikLiftStatus.getMsg(), shelfCode);
    }
}
